package com;


import cn.hutool.core.codec.Base64Decoder;
import cn.hutool.core.date.StopWatch;

import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
 * 比较 stream parallelStream HashSet 的去重对象速度
 *
 * @author yunlongn
 */
public class Test03 {



    public static void main(String[] args) {
        byte[] bytes = Base64Decoder.decode("MQAAAOgDAAByHwAAMQAAAIYfAAD6HgAAch8AAAAAAABAHwAAAAAAACwfAAAAAAAAIh8AAAAAAAAsHwAAAAAAACIfAAAAAAAAGB8AAAAAAAAiHwAAAAAAABgfAAAAAAAAIh8AAAAAAAAiHwAAAAAAABgfAAAAAAAAGB8AAAAAAAAiHwAAAAAAABgfAAAAAAAAGB8AAAAAAAAOHwAAAAAAABgfAAAAAAAAIh8AAAAAAAAYHwAAAAAAABgfAAAAAAAAGB8AAAAAAAAOHwAAAAAAAA4fAAAAAAAABB8AAAAAAAAEHwAAAAAAABgfAAAAAAAADh8AAAAAAAAOHwAAAAAAABgfAAAAAAAALB8AAAAAAAA2HwAAAAAAAEAfAAAAAAAALB8AAAAAAAA2HwAAAAAAACwfAAAAAAAANh8AAAAAAAAiHwAAAAAAACIfAAAAAAAALB8AAAAAAAA2HwAAAAAAACwfAAAAAAAALB8AAAAAAAA2HwAAAAAAADYfAAAAAAAANh8AAAAAAAA2HwAAAAAAACIfAAAAAAAAIh8AAAAAAAA=");
        System.out.println(bytes);
        ByteBuffer byteBuffer = ByteBuffer.allocate(2048);
        byteBuffer.put(bytes);
        byteBuffer.rewind();
//        byteBuffer.position(8);
//        for (int i = 0; i < 100; i++) {
//
//            System.out.println(byteBuffer.getInt());
//        }
        System.out.println(SrStruct.translation(Test04.class, byteBuffer, 8));; //1914634240
    }
   public static class Test04 {
       @Struct(order = 0, length = 4)
        String nCount;
       @Struct(order = 1, length = 4)
        int nPriceUnit;
       @Struct(order = 2, length = 4)
        int nClose_P;
       @Struct(order = 3, length = 4)
         int nMaxCount;
       @Struct(order = 4, length = 4)
        int nHighPrice;
       @Struct(order = 5, length = 4)
        int nLowPrice;
       @Struct(order = 6)
        String ATTrendNewPrice;

       public String getnCount() {
           return nCount;
       }

       public void setNCount(String nCount) {
           this.nCount = nCount;
       }

       public int getnPriceUnit() {
           return nPriceUnit;
       }

       public void setNPriceUnit(int nPriceUnit) {
           this.nPriceUnit = nPriceUnit;
       }

       public int getNClose_P() {
           return nClose_P;
       }

       public void setNClose_P(int nClose_P) {
           this.nClose_P = nClose_P;
       }

       public int getNMaxCount() {
           return nMaxCount;
       }

       public void setNMaxCount(int nMaxCount) {
           this.nMaxCount = nMaxCount;
       }

       public int getNHighPrice() {
           return nHighPrice;
       }

       public void setNHighPrice(int nHighPrice) {
           this.nHighPrice = nHighPrice;
       }

       public int getnLowPrice() {
           return nLowPrice;
       }

       public void setNLowPrice(int nLowPrice) {
           this.nLowPrice = nLowPrice;
       }

       public String getATTrendNewPrice() {
           return ATTrendNewPrice;
       }

       public void setATTrendNewPrice(String ATTrendNewPrice) {
           this.ATTrendNewPrice = ATTrendNewPrice;
       }

       @Override
       public String toString() {
           return "Test04{" +
                   "nCount=" + nCount +
                   ", nPriceUnit=" + nPriceUnit +
                   ", nClose_P=" + nClose_P +
                   ", nMaxCount=" + nMaxCount +
                   ", nHighPrice=" + nHighPrice +
                   ", nLowPrice=" + nLowPrice +
                   ", ATTrendNewPrice=" + ATTrendNewPrice +
                   '}';
       }
   }
    

}

